'use strict';

const Controller = require('egg').Controller;
const { getCookieValue } = require('../public/processCookies');
class OperationLogController extends Controller {
  async list() {
    const params = this.ctx.query;
    const { id: tid } = getCookieValue(this.ctx.cookies, 'token', 'tenant');
    params.tid = tid;
    const result = await this.ctx.service.operationLog.list(params);
    this.ctx.body = {
      msg: '',
      status: 200,
      count: result.count,
      data: result.rows,
    };
  }
}

module.exports = OperationLogController;
